import Vue from 'vue'
import VueRouter from 'vue-router'
 //Vue中使用router插件
Vue.use(VueRouter)
 //路由配置，配置路由路径与组件的对应关系
const routes = [        
  {
    path: '/',
    name: 'Home',
    component: () => import('../views/Home.vue')
  },
  {
    path: '/home',
    name: 'Home',
    component: () => import('../views/Home.vue')
  },
  {
    path: '/about',
    name: 'About',
    component: () => import('../views/About.vue')
  },
  {
    path: '/pageA',
    name: 'pageA',
    component: () => import('../views/pageA.vue')
  },
  {
    path: '/pageB',
    name: 'pageB',
    component: () => import('../views/pageB.vue')
  }
] 
 //新建路由实例
const router = new VueRouter({ 
  routes
}) 
 //导出路由实例，在main.js中导入使用
export default router  
